const Router = require("koa-router");

const { login, success } = require("../controller/auth.controller");
// 验证用户名是否存在、用户名和密码是否为空、密码是否正确
const { verifyLogin, verifyAuth } = require("../middleware/auth.middleware");
const AuthRouter = new Router();
// 登录接口
AuthRouter.post("/login", verifyLogin, login);
// 授权接口
AuthRouter.get("/verify", verifyAuth, success);

module.exports = AuthRouter;
